Source Property (Attachment Object)
The Source
property returns or sets the full path and filename, OLE class name, or unique
message identifier for the attachment. Read/write.
Syntax
objAttachment.Source
Data Type
String
Remarks
The Source
property returns or sets the full path and filename of the attachment data file
for mapiFileData and mapiFileLink attachments. It returns or sets
the OLE class name of the attachment for mapiOLE attachments. For mapiEmbeddedMessage
attachments, the Source property is set with the ID
The OLE
Messaging Library does not synchronize the Source property and the ReadFromFile
The return
value of the Source property depends on the value of the Type
Type
property |
Source
property |
mapiFileData
|
Not used;
contains an empty string. |
mapiFileLink
|
Specifies a
full path name in a universal naming convention (UNC) format, such as
\\SALES\INFO\PRODUCTS\NEWS.DOC. |
mapiOLE |
Specifies
the registered OLE class name of the attachment, such as Word.Document or
PowerPoint.Show. |
mapiEmbeddedMessage
|
Specifies
the embedded Message |
The UNC
format is suitable for sending attachments to recipients who have access to a
common file server.
The Source
property corresponds to the MAPI property PR_ATTACH_PATHNAME.
Example
' from the function Attachments_Add()
Set
objAttach = objAttachColl.Add '
add an attachment
With
objAttach
.Type
= mapiFileLink
.Position = 0 ' place at end of
message
.Source = "\\server\bitmaps\honey.bmp" ' UNC name
End With
' must
update the message to save the new info
objOneMsg.Update ' update the
message
MsgBox
"Added an attachment of type mapiFileLink"
See Also
Add Method (Attachments Collection)